package com.codeape.fast.ui.login;

import android.view.View;

import androidx.annotation.Nullable;

import java.util.Objects;

import android.view.TextureView;
import android.view.AbsSavedState;
import android.view.ViewStub;
/**
 *       Authentication result : success (user details) or error message.
 */
class   LoginResult   implements View.OnClickListener {
    @Nullable    private LoggedInUserView success;
    @Nullable
    private    Integer error;

        LoginResult(@Nullable Integer error) {
        this.error = error;
    }

    LoginResult(@Nullable LoggedInUserView success) {
        this.success = success;
    }

    @Override
    public void onClick(View v) {

    }

    @Nullable
    LoggedInUserView getSuccess() {
        return success;
    }

    @Nullable
    Integer getError() {
        return error;
    }

    public LoginResult(@Nullable LoggedInUserView success, @Nullable Integer error) {
        this.success = success;
        this.error = error;
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        LoginResult that = (LoginResult) o;
        return Objects.equals(success, that.success) && Objects.equals(error, that.error);
    }

    @Override
    public int hashCode() {
        return Objects.hash(success, error);
    }

    @Override
    public String toString() {
        return "LoginResult{" +
                "success=" + success +
                ", error=" + error +
                '}';
    }

}